1. Technical Field
The present invention relates to image processing using an error diffusion method. Specifically, the present invention relates to an image processing device, an image processing method, and a program that can prevent so-called “dot generation delay”, which occurs when converting M-level image data into N-level image data, by using the error diffusion method.
2. Related Art
An error diffusion method is an image processing method for converting gradation value of a pixel of M-level image data into a pixel of N-level image data. Here, M and N are integers that satisfy M>N. An error diffusion method is disclosed in, for example, “An Adaptive Algorithm for Spatial Gray Scale”, Society for Information Display 1975 Symposium Digest of Technical Papers, published by the Society for Information Display, 1975, p. 36.
Here, a summary of an error diffusion method will be described.
FIG. 7 shows an order of image processing by an error diffusion method. FIG. 8 shows an example of an error diffusion matrix. According to the error diffusion method, the image processing is started with the top left pixel of an image. First, the pixels of the top line are processed one by one, from left to right. After the top line is completed, the pixels of the second line are processed one by one, from left to right. Here, an explanation will be given of an example of converting 16-level image data into binary image data (in other words, 2-level image data). In a case that a gradation value of a target pixel is below a threshold value, the binarized gradation value is determined as “0”. In other words, no ink dot is formed at a location corresponding to the target pixel. On the contrary, in a case that a gradation value of a target pixel is above the threshold value, the binarized gradation value is determined as “1”. In other words, an ink dot is formed at a location corresponding to the target pixel. As a result of binarization, an error, which is a difference between gradation values before and after the binarization, is generated. The generated error is diffused into peripheral unprocessed pixels in accordance with the error diffusion matrix shown in FIG. 8. In the peripheral pixels, a gradation value is updated by addition of the diffused error. The error diffusion method is an image processing method to make macroscopic density of an output image to be equal to that of the input image.